package xin.marcher.module.construction.converter;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import xin.marcher.module.construction.domain.dto.CategoryInfoDTO;
import xin.marcher.module.construction.domain.dto.CategoryInfoTreeDTO;
import xin.marcher.module.construction.domain.entity.CategoryInfoDO;
import xin.marcher.module.construction.domain.entity.CategoryInfoTreeDO;
import xin.marcher.module.construction.domain.request.CategoryRequest;
import xin.marcher.module.construction.domain.request.QueryCategoryRequest;

import java.util.List;

/**
 * 品类相关对象克隆
 *
 * 
 */
@Mapper(componentModel = "spring")
public interface CategoryInfoConverter {
    /**
     * 对象克隆
     *
     * @param categoryQueryRequest
     * @return
     */
    CategoryInfoDO converterDO(QueryCategoryRequest categoryQueryRequest);

    /**
     * 集合对象克隆
     *
     * @param list
     * @return
     */
    List<CategoryInfoDTO> converterList(List<CategoryInfoDO> list);

    /**
     * 集合对象克隆
     *
     * @param list
     * @return
     */
    List<CategoryInfoTreeDTO> converterTreeList(List<CategoryInfoTreeDO> list);

    /**
     * 对象克隆
     *
     * @param request
     * @return
     */
    @Mappings({
            @Mapping(target = "updateUser", source = "operateUser")
    })
    CategoryInfoDO converterDO(CategoryRequest request);

}
